<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 求两个数的和
      function getSum(num1, num2) {
        return num1 + num2
      }
      var res3 = getSum(1, 12)
      console.log(res3)

      //  求任意两个数之间的和
      function getSums(start, end) {
        var sum = 0
        for (var i = start; i <= end; i++) {
          sum += i
        }
        return sum
      }
      var res1 = getSums(1, 100)
      var res2 = getSums(1, 10)
      console.log(res1)
      console.log(res2)
    </script>
  </body>
</html>
